home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKitArchive.mbox / mbox / 000268_misckit-reques…aska.et.byu.edu_Thu Oct 6 15:20:50 1994.msg < prev    next >
Internet Message Format  |  1994-10-30  |  4KB

  1. Return-Path: <misckit-request@alaska.et.byu.edu>
  2. Received: from alaska.et.byu.edu by darth.byu.edu (NX5.67d/NX3.0M)
  3.     id AA01124; Thu, 6 Oct 94 15:20:40 -0600
  4. Received: from acs1.byu.edu by alaska.et.byu.edu; Thu, 6 Oct 1994 14:56:57 -0600
  5. Received: from DIRECTORY-DAEMON by yvax.byu.edu (PMDF V4.3-10 #7277)
  6.  id <01HHYKPTFQ7K9200OH@yvax.byu.edu>; Thu, 06 Oct 1994 14:56:38 -0600 (MDT)
  7. Received: from alaska.et.byu.edu by yvax.byu.edu (PMDF V4.3-10 #7277)
  8.  id <01HHYKOQ0HKW93FDZE@yvax.byu.edu>; Thu, 06 Oct 1994 14:55:40 -0600 (MDT)
  9. Received: from acs1.byu.edu by alaska.et.byu.edu; Thu, 6 Oct 1994 14:53:55 -0600
  10. Received: from DIRECTORY-DAEMON by yvax.byu.edu (PMDF V4.3-10 #7277)
  11.  id <01HHYKM8IX5C9N68TN@yvax.byu.edu>; Thu, 06 Oct 1994 14:53:38 -0600 (MDT)
  12. Received: from skycat.usask.ca by yvax.byu.edu (PMDF V4.3-10 #7277)
  13.  id <01HHYKLTKW5C93G5ED@yvax.byu.edu>; Thu, 06 Oct 1994 14:53:20 -0600 (MDT)
  14. Received: from skatter.USask.Ca.usask.ca (skatter.usask.ca)
  15.  by SKYCAT.USask.CA (PMDF V4.3-11 #5952)
  16.  id <01HHYKK244FK8Y5DPQ@SKYCAT.USask.CA>; Thu, 06 Oct 1994 14:51:52 -0600 (CST)
  17. Received: from pisces (pisces.usask.ca) by skatter.USask.Ca.usask.ca
  18.  (4.1/SMI-4.1) id AA02356; Thu, 6 Oct 94 14:51:39 CST
  19. Received: by pisces (NX5.67e/NX3.0X) id AA02677; Thu, 6 Oct 94 14:51:38 -0600
  20. Received: by NeXT.Mailer (1.100)
  21. Received: by NeXT Mailer (1.100)
  22. Date: Thu, 06 Oct 1994 14:51:38 -0600
  23. From: eric@skatter.usask.ca (Eric Norum)
  24. Subject: MiscString leaks memory when used as a Distributed Object.
  25. To: misckit@byu.edu
  26. Cc: eric@skatter.usask.ca
  27. Message-Id: <9410062051.AA02356@skatter.USask.Ca.usask.ca>
  28. Content-Transfer-Encoding: 7BIT
  29.  
  30. Ooops.  I clicked on the wrong button with my previous letter.
  31. Sorry about that.
  32.  
  33. Here's the protocol for a simple server:
  34.         @protocol CommMethods
  35.         - (int)checkInString:(in MiscString *)s;
  36.         @end
  37.  
  38. And here's the implementation:
  39.         - (int)checkInString:(MiscString *)s
  40.         {
  41.                 const char *cp = [s stringValue];
  42.                 return strlen (cp);
  43.         }
  44.  
  45. Every time a client sends one of these messages, the server leaks an amount of
  46. memory equal to the length, including the terminating '\0' byte, of the string
  47. sent by the *previous* message.
  48.  
  49. Is this leak related to the bug mentioned in the 3.2 release notes:
  50.         Known Problems
  51.  
  52.         Reference:      21973
  53.  
  54.         Problem:        Server memory not freed for string arguments.
  55.  
  56.         Description:    When using Distributed Objects, if you pass a string
  57.                         (using char * or const char *) as an argument to a
  58.                         Distributed Objects server, the memory allocated by
  59.                         the server for this argument is not freed. 
  60.  
  61.         Workaround:     None.
  62.  
  63. Here's the call chain, as reported by MallocDebug:
  64. default  0x0625d120      7
  65.                 _NXDecodeChars,
  66.                 idecodeData,
  67.                 -[NXPortPortal decodeData:ofType:],
  68.                 -[NXMethodSignature decodeMethodRetFrom:withargs:atAddr:],
  69.                 -[NXProxy forward::],
  70.                 _objc_msgForward,
  71.                 -[CommServer checkInString:],
  72.                 objc_msgSendv
  73.  
  74. This is a *big* problem if there is, in fact, no workaround.
  75. My server is growing 3.5 megabytes a day........
  76.  
  77.  
  78. Eric Norum                             eric@skatter.usask.ca
  79. Saskatchewan Accelerator Laboratory
  80. University of Saskatchewan
  81. Saskatoon, Canada.                     NeXTMail accepted.